﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="~/Restricted/SearchSite.aspx.cs" Inherits="SearchSite" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    
    
    <div class="subhead">
        <img class="subheadImage" src="../images/slide-03.jpg" />
        <div class="container">
            <div class="subheadText">
                <h1 class="featurette-heading">Find din date her
                </h1>
            </div>
        </div>
    </div>


    <div class="container" id="content">

        <div class="row" style="margin-left: -20px">
            <div class="span12">
                <div class="row" style="margin-top: 30px">
                    <div class="span2 offset1">
                        <h4 class="text-center">Jeg søger</h4>
                        <asp:DropDownList runat="server" ID="selectGender" CssClass="span2" AppendDataBoundItems="true" ViewStateMode="Enabled" OnSelectedIndexChanged="selectGender_SelectedIndexChanged" AutoPostBack="true">
                            <asp:ListItem Value="0">Vælg køn</asp:ListItem>
                        </asp:DropDownList>
                    </div>
                    <div class="span6">
                        <h4 class="text-center">Sted</h4>
                        <asp:DropDownList runat="server" ID="selectPlace" CssClass="span3" AppendDataBoundItems="true" OnSelectedIndexChanged="selectPlace_SelectedIndexChanged" AutoPostBack="true" Enabled="false">
                            <asp:ListItem Value="0">Vælg region</asp:ListItem>
                        </asp:DropDownList>
                        <asp:TextBox runat="server" ID="CityZipcodeTxt" Placeholder="Søg by/postnr" CssClass="span3" Enabled="false" />
                        <cc1:AutoCompleteExtender runat="server" ID="autoComplete1" CompletionListItemCssClass="CitySearchAutocomplete" CompletionListHighlightedItemCssClass="CitySearchAutocompleteHighlighted" ServiceMethod="GetCompletionList" TargetControlID="CityZipcodeTxt" UseContextKey="true" CompletionListCssClass="z-index: 1000;"></cc1:AutoCompleteExtender>
                    </div>
                    <div class="span2">
                        <h4 class="text-center">Alder</h4>
                        <div class="row">
                            <asp:TextBox runat="server" ID="TxtAgeMin" CssClass="span1" AutoPostBack="true" OnTextChanged="TxtAgeMin_TextChanged" Enabled="false" />
                            -
                                <asp:TextBox runat="server" ID="TxtAgeMax" CssClass="span1" AutoPostBack="true" OnTextChanged="TxtAgeMax_TextChanged" Enabled="false" />
                        </div>
                    </div>
                    <div class="row">
                        <div class="span6 offset3 pull-right">
                            <asp:DropDownList runat="server" ID="CityRadiusDDL" OnSelectedIndexChanged="CityRadiusDDL_SelectedIndexChanged" AutoPostBack="true">
                                <asp:ListItem Text="10" />
                                <asp:ListItem Text="20" />
                                <asp:ListItem Text="30" />
                                <asp:ListItem Text="40" />
                                <asp:ListItem Text="50" />
                                <asp:ListItem Text="100" />
                            </asp:DropDownList>
                            <asp:TextBox runat="server" ID="DistanceSliderBox" OnTextChanged="DistanceSliderShowBox_TextChanged" OnDataBinding="DistanceSliderShowBox_TextChanged" AutoPostBack="true"/>
                            <cc1:SliderExtender runat="server" RaiseChangeOnlyOnMouseUp="true" Length="220" ID="DistanceSlider1" TargetControlID="DistanceSliderBox" BoundControlID="RadiusKM" Minimum="0" Maximum="100" Steps="11"></cc1:SliderExtender>
                            <asp:Label ID="Label1" Text="Indenfor" runat="server" />
                            <asp:Label ID="RadiusKM" runat="server" />
                            <asp:Label ID="Label2" Text="km" runat="server" />
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <hr class="content-divider" style="margin-top: 10px"></hr>

        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
        <asp:ListView runat="server" ID="LWDatelist">
            <ItemTemplate>
                <div class="row">
                    <a href="Datesite.aspx?datenightid=<%#Eval("DatenightId") %>" id="DateLinkBtn">
                        <div class="span2 offset1">
                            <img id="DateProfilePicture" class="img-rounded" src="<%#Eval("Profile") %>"></img>
                        </div>
                        <div class="span3">
                            <div class="DateinfoLeft">
                                <%#Eval("Username") %>
                                <br />
                                <%#Eval("Cityname") %>
                                <br />
                                <%#Eval("Age") %> år
                                <br />
                                <%#Eval("Date") %>
                                <br />
                            </div>
                        </div>
                        <div class="span5" id="DateDescription">
                            <%#Eval("Description") %>
                        </div>
                    </a>
                </div>
                <hr class="content-divider"></hr>
            </ItemTemplate>
        </asp:ListView>
        <div style="text-align: center;">
            <asp:DataPager ID="DataPager1" runat="server" PagedControlID="LWDatelist" PageSize="10">
                <Fields>
                    <asp:NumericPagerField ButtonCount="10" NumericButtonCssClass="pagingBottom" CurrentPageLabelCssClass="pagingBottomActive" />
                </Fields>
            </asp:DataPager>
        </div>
            </ContentTemplate>
        </asp:UpdatePanel>
        <hr class="content-divider"></hr>

    </div>



    <hr class="content-divider"></hr>

    <div id="DateCreatedPopup" style="visibility: hidden">
        <div id="DateCreatedPopupInner">
            <h2 id="PopupMessage"></h2>
        </div>
    </div>

    <script>

        if ($.url().param("datecreatesucces") == "true") {
            $(document).ready(function () {
                document.getElementById("DateCreatedPopup").style.visibility = "visible";
                document.getElementById("PopupMessage").textContent = "Daten er oprettet";
                setTimeout(function () {
                    $('#DateCreatedPopup').fadeOut();
                }, 3000);
            });
        }
        else if ($.url().param("dateupdatesucces") == "true") {
            $(document).ready(function () {
                document.getElementById("DateCreatedPopup").style.visibility = "visible";
                document.getElementById("PopupMessage").textContent = "Daten er opdateret";
                setTimeout(function () {
                    $('#DateCreatedPopup').fadeOut();
                }, 3000);
            });
        }
        else if ($.url().param("datedeletesucces") == "true") {
            $(document).ready(function () {
                document.getElementById("DateCreatedPopup").style.visibility = "visible";
                document.getElementById("PopupMessage").textContent = "Daten blev slettet";
                setTimeout(function () {
                    $('#DateCreatedPopup').fadeOut();
                }, 3000);
            });
        }

    </script>
</asp:Content>


